/**************************************************************************
 * @doc PIP
 * @module isoutl.h |  
 * Header file used to communicate via the ISO8583 Mesaage Engine and the PIP Engine.
 *
 * Product     :   SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   : 
 * <nl>Notes       :
 *
 * @head3 PIP & ISO Functions |
 * @index | PIP
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 * 
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form 
 * or by any means whether electronic, mechanical, magnetic, optical, 
 * or otherwise, without the express prior written permission of VeriFone, Inc.
   
$Log: /SoftPay/SPK2SIM/Source/Include/isoutl.h $ 
**************************************************************************/

#ifndef ISOUTL
#define ISOUTL

#ifdef PIP_DEFINED

#include <amexhost.h>
#include <bmp.h>
#include <transact.h>
#include <isoload.h>

/* ISO 8583 format specific informations */

typedef VALIDATION_STRUCT srValidationStruct;
extern HOST_8583_DATA *psrHostData;

int inAddPIPISOFunctions(void);
int inSetTransFields (TRANSACTION_OBJECT *pobTran, int host, unsigned short shTransCode, char *szProcCode);
int inDefaultSetTransFields (TRANSACTION_OBJECT *pobTran, int host, unsigned short  inTransCode, char *szProcCode);
int inUpdateReversal (COMM_8583_DATA *srCommStruct);
int inDefaultUpdateReversal (COMM_8583_DATA *srCommStruct);
void vdInitializeValidationStruct (TRANSACTION_OBJECT * pobTran, VALIDATION_STRUCT *psrValidationParameters);
int inDefaultInitValidationStruct(TRANSACTION_OBJECT * pobTran, VALIDATION_STRUCT *psrValidationParameters);
int inResetCommDataFields (void);
int inDefaultResetCommData (void);
void vdFreeCommData(COMM_8583_DATA *psrCommData);
void vdFreeVariantTables(void);
int inResetHostDataFields (void);
int inDefaultResetHostData (void);
void vdFreeHostData(HOST_8583_DATA *psrHostData);
HOST_8583_DATA *psrCreateHostData(void);
COMM_8583_DATA *psrCreateCommData(TRANSACTION_OBJECT * pobTran, int inISOPacketSize, VS_BOOL fReversalFlag);
int inGetBitmapRecord(BMP_REC *psrBMPRec, short shTransCode);
int inLoadBitmap (unsigned short shTransCode, unsigned char *btMti, unsigned char *btMap8583, unsigned char *btProcCode);
int inLoadTransData (TRANSACTION_OBJECT *pobTran, char *pstBitMap, ISOLOAD *psrLoadDataFuncs);
int inTxRx8583 (int inModem, int inMode, unsigned char *pstReqBuf, unsigned int inReqSiz, unsigned char *pstRespBuf,
	unsigned int inRespSiz, unsigned int inRespTimout, unsigned int inCarrierTimout);
int inBaseValidationLow (VALIDATION_STRUCT *psrRespValStruct, int dummy);
int inBaseRespValidation (VALIDATION_STRUCT *psrRespValStruct, int  inInternalVal);
int inBaseRespValidationWithDupChk (VALIDATION_STRUCT *psrRespValStruct, int  inInternalVal);
int ISOUTL_CODE_CHECK(char * a,char *b,short *  c,char * d,unsigned char * e);

void vdSet64BitMapStop(unsigned char *);
void vdReset64BitMapStop(unsigned char *);

extern unsigned char stMap8583[];
extern unsigned char stRevFileName[];

#ifdef PRINTISO_DEFINED
int inPrintISOPacket(VS_BOOL fSendPacket, unsigned char *pucMessage, int inLen); //jrd 01052004
#endif /* PRINTISO_DEFINED */



#endif /* PIP_DEFINED */

#endif /* ISOUTL */

